<?php echo $this->Html->script(array('jNice')); ?>
<script type="text/javascript">
    jQuery('.scroll-pane').jScrollPane({ 
        verticalDragMaxHeight: 44,
        verticalTrackHeight : 300
    });
    jQuery('.textScroller').jScrollPane({
        verticalDragMaxHeight: 21
    });
    jQuery('.textScrollerProgramCreate').jScrollPane({
        verticalDragMaxHeight: 21
    });
    jQuery("#start_Date").datepicker({ dateFormat: 'yy-mm-dd' });
    jQuery("#end_date").datepicker({ dateFormat: 'yy-mm-dd' });
    jQuery("#when_date").datepicker({ dateFormat: 'yy-mm-dd' });
</script>

<div id="result">
    <?php echo $this->Session->flash(); ?>

    <?php    
    echo $this->Form->create('Program', array('class' => 'jNice', 'inputDefaults' => array('label' => false, 'div' => false, 'error' => false)));
    echo $this->Form->input('user_id', array('type' => 'hidden', 'value' => $session->read('Auth.User.id')));
    ?>
    <div class="scollCont scroll-pane">
        <div class="padder">
            <div class="formBlock">                                 
                <div class="vision">
                    <h3 class="profileLabel">WHAT</h3><?php echo $this->Form->error('what'); ?>
                    <div class="textFieldWrapper">
                        <div class="textFieldRight">
                            <div>
                                <?php echo $this->Form->input('what', array('class' => 'textFieldTypePlace')); ?>
                            </div>
                        </div>                                        
                    </div>

                    <div class="uploadImg" style="">
                        <h3 class="profileLabel">WHY</h3><?php echo $this->Form->error('why'); ?>
                        <div class="textAreaWrapper">
                            <div class="textAreaRight">
                                <div class="textAreaRptr">
                                    <div class="textScrollerProgramCreate textScollImg" style="height:93px;">
                                        <?php echo $this->Form->input('why', array('type' => 'textarea')); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="uploadImg inspire">
                        <h3 class="profileLabel">WHEN</h3><?php echo $this->Form->error('when_start'); ?>
                        <div class="textFieldWrapper lessMargin">
                            <div class="textFieldRight">
                                <div><label>START</label> <?php echo $this->Form->input('when_start', array('class' => 'textFieldTypePlace textField289','id'=>'start_Date', 'type' => "text")); ?></div>
                            </div>
                        </div><?php echo $this->Form->error('when_end'); ?>
                        <div class="textFieldWrapper lessMargin">
                            <div class="textFieldRight">
                                <div><label>END</label>
                                     <?php echo $this->Form->input('when_end', array('class' => 'textFieldTypePlace textField289','id'=>'end_date', 'type' => "text")); ?>
                                </div>
                            </div>                                             
                        </div>
                    </div>
                    <div class="clear">&nbsp;</div>
                    <h3 class="profileLabel">FOCUS AREAS</h3><?php echo $this->Form->error('focus_area_id'); ?>
                    <div class="checkBoxes">
                        <?php                        
                        foreach ($focus_areas as $key => $val) {
                            $checked ='';                            
                            if(isset($this->data['Program']['focus_area_id'][$key]))
                                  $checked = ' checked="checked"';
                             ?>
                        <input type="checkbox" name='data[Program][focus_area_id][<?php echo $key;?>]' value = "<?php echo $key;?>"  <?php echo $checked; ?>  /><label><?php echo $val; ?></label>
                        <?php } ?>                                                 

                        <div class="clear">&nbsp;</div>
                    </div>

                </div>
            </div>
            <div class="weWill">
                <div class="willWill">
                    <h3 class="profileLabel">WE WILL...</h3><?php echo $this->Form->error('Will.0.i_will'); ?>
                    <div class="textFieldWrapper">
                        <div class="textFieldRight">
                            <div>
                                <?php echo $this->Form->input('Will.0.i_will', array('class' => 'textField457')); ?>
                            </div>
                        </div>                                        
                    </div>
                </div>
                <div class="willWhen">
                    <h3 class="profileLabel">WHEN</h3><?php echo $this->Form->error('Will.0.when_date'); ?>
                    <div class="textFieldWrapper">
                        <div class="textFieldRight">
                            <div>
                                <?php echo $this->Form->input('Will.0.when_date', array('class' => 'textField289', 'id' => 'when_date', 'type' => 'text')); ?>
                            </div>
                        </div>                                        
                    </div>
                </div>
                <div class="uploadImg">
                    <h3 class="profileLabel">HOW</h3><?php echo $this->Form->error('Will.0.how'); ?>
                    <div class="textAreaWrapper">
                        <div class="textAreaRight">
                            <div class="textAreaRptr">
                                <div class="textScrollerProgramCreate textScollImg" style="height:93px;">
                                    <?php echo $this->Form->input('Will.0.how', array('type' => 'textarea')); ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                 <div class="willWhen" style="margin-left:92px">
                    <?php echo $this->Form->error('Will.recuring'); ?>
                    <div class="willCheckBoxes">
                        <?php echo $this->Form->checkbox('Will.recuring', array('name' => 'data[Will][recuring][]', 'value' => 'complete By this day', 'hiddenField' => false)); ?>
                        <label>complete By this day</label>
                    </div>    
                    <div class="willCheckBoxes">
                        <?php echo $this->Form->checkbox('Will.recuring', array('name' => 'data[Will][recuring][]', 'value' => 'complete ON this day', 'hiddenField' => false)); ?>
                        <label>complete ON this day</label>
                    </div>    
                    <div class="willCheckBoxes">
                        <?php echo $this->Form->checkbox('Will.recuring', array('name' => 'data[Will][recuring][]', 'value' => 'recurring DAILY', 'hiddenField' => false)); ?>
                        <label>recurring DAILY</label>
                    </div>    
                    <div class="willCheckBoxes">  
                        <?php echo $this->Form->checkbox('Will.recuring', array('name' => 'data[Will][recuring][]', 'value' => 'recurring WEEKLY', 'hiddenField' => false)); ?>
                        <label>recurring WEEKLY</label>
                    </div>    
                    <div class="willCheckBoxes">  
                        <?php echo $this->Form->checkbox('Will.recuring', array('name' => 'data[Will][recuring][]', 'value' => 'recurring MONTHLY', 'hiddenField' => false)); ?>
                        <label>recurring MONTHLY</label>
                    </div>    
                     <div class="clear">&nbsp;</div>
                     <input type="button" name="" value="ADD ANOTHER" style="float:right;" />
                </div>
                <div class="clear">&nbsp;</div>
            </div>
        </div>
    </div>
<?php echo $ajax->submit('GO!', array('url' => array('controller' => 'programs', 'action' => 'create'), 'update' => 'result', 'class' => 'saveInfo', 'div' => false)); ?>
</form>
</div>